<?php
/*
 * @Author: 李诗韵 11366530+li-shiyun-shihan@user.noreply.gitee.com
 * @Date: 2022-08-17 18:57:38
 * @LastEditors: 李诗韵 11366530+li-shiyun-shihan@user.noreply.gitee.com
 * @LastEditTime: 2022-08-17 19:25:24
 * @FilePath: \前端开发c:\phpStudy\WWW\item\lin\server\order.php
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
header("content-type:text/html;charset=utf-8");
$conn = mysql_connect("localhost","root","root");
$com =  mysql_select_db("library");
$sql = "select * from orderinfo inner join userinfo where orderinfo.did = userinfo.uid ";
$res = mysql_query($sql);
$arr = array();
while($row = mysql_fetch_assoc($res)){
    //往数组当中添加数据
    array_push($arr,$row);//将$row里面的数据push到$arr;
}
print_r(json_encode($arr));
?>